package model

import (
	"time"
)

type Refund struct {
	ID                    uint `gorm:"primarykey;comment:自增ID"`
	CreatedAt             time.Time
	UpdatedAt             time.Time
	ExceptionType         int       `json:"exceptionType" gorm:"column:exceptionType;comment:-"`
	SkuImageUrl           string    `json:"skuImageUrl" gorm:"column:skuImageUrl;comment:-"`
	Quantity              int       `json:"quantity" gorm:"column:quantity;comment:-"`
	ExternalOrderType     int       `json:"externalOrderType" gorm:"column:externalOrderType;comment:-"` // 来源类型：5货件，1发货单，2客退返仓，4拒签返仓，3仓库巡检
	LogisticCompany       string    `json:"logisticCompany" gorm:"column:logisticCompany;comment:-"`
	ReturnCountDown       string    `json:"returnCountDown" gorm:"column:returnCountDown;comment:-"`
	ItemNo                string    `json:"itemNo" gorm:"column:itemNo;comment:-"`
	ExternalOrderId       string    `json:"externalOrderId" gorm:"column:externalOrderId;comment:-"`
	JoinReturnDate        time.Time `json:"joinReturnDate" gorm:"column:joinReturnDate;comment:-"`
	SkuAttribute          string    `json:"skuAttribute" gorm:"column:skuAttribute;comment:-"`
	ItemId                uint      `json:"itemId" gorm:"column:itemId;comment:-"`
	ItemName              string    `json:"itemName" gorm:"column:itemName;comment:-"`
	SkuNo                 string    `json:"skuNo" gorm:"column:skuNo;comment:-"`
	SsuId                 string    `json:"ssuId" gorm:"column:ssuId;comment:-"`
	ShopId                uint      `json:"shopId" gorm:"column:shopId;comment:-"`
	ExternalOrderTypeDesc string    `json:"externalOrderTypeDesc" gorm:"column:externalOrderTypeDesc;comment:-"`
	OriginId              uint      `json:"origin_id" gorm:"column:origin_id;comment:-"`
	ExceptionTypeDesc     string    `json:"exceptionTypeDesc" gorm:"column:exceptionTypeDesc;comment:-"`
	TrackingNumber        string    `json:"trackingNumber" gorm:"column:trackingNumber;comment:-"`
	ConfirmType           int       `json:"confirmType" gorm:"column:confirmType;comment:-"` // 状态：0待确认，1确认退货，2确认报废
	SkuId                 int       `json:"skuId" gorm:"column:skuId;comment:-"`
}

type RefundWithExtra struct {
	Refund
	RefundRefundProcess                 *RefundRefundProcess `json:"refundProcess" bson:"refundProcess"`
}

type RefundRefundProcess struct {
	LastUpdateUser     string `json:"lastUpdateUser" bson:"lastUpdateUser"`
	LastUpdateAt       time.Time `json:"lastUpdateAt" bson:"lastUpdateAt"`
	LastProcessDate    string `json:"lastProcessDate" bson:"lastProcessDate"`
	LastProcessContent string `json:"lastProcessContent" bson:"lastProcessContent"`
	UpdateAtOverTime   string `json:"updateAtOverTime" bson:"updateAtOverTime"`
}

type RefundImg struct {
	ID        uint `gorm:"primarykey;comment:自增ID"`
	CreatedAt time.Time
	UpdatedAt time.Time
	RefundId  uint          `json:"refund_id" gorm:"column:refund_id;comment:-"`
	Data      RefundImgData `json:"data" gorm:"type:json;column:data;comment:-"`
}
type RefundImgData map[string]interface{}

type RefundDetail struct {
	ReturnOrderNumber   string                   `json:"returnOrderNumber" bson:"returnOrderNumber"`
	ReturnOrderSkuList  []map[string]interface{} `json:"returnOrderSkuList" bson:"returnOrderSkuList"`
	ItemType            int                      `json:"itemType" bson:"itemType"`
	StatusDesc          string                   `json:"statusDesc" bson:"statusDesc"`
	ItemTypeDesc        string                   `json:"itemTypeDesc" bson:"itemTypeDesc"`
	RtAddress           map[string]interface{}   `json:"rtAddress" bson:"rtAddress"`
	OutboundOrderId     int                      `json:"outboundOrderId" bson:"outboundOrderId"`
	ReceivedAt          int                      `json:"receivedAt" bson:"receivedAt"`
	WarehouseName       string                   `json:"warehouseName" bson:"warehouseName"`
	ReturnAddress       string                   `json:"returnAddress" bson:"returnAddress"`
	ShipmentType        string                   `json:"shipmentType" bson:"shipmentType"`
	MerchantPackageList []map[string]interface{} `json:"merchantPackageList" bson:"merchantPackageList"`
	CreatedAt           int                      `json:"createdAt" bson:"createdAt"`
	TotalQuantity       int                      `json:"totalQuantity" bson:"totalQuantity"`
	WarehouseId         int                      `json:"warehouseId" bson:"warehouseId"`
	ShippedAt           int                      `json:"shippedAt" bson:"shippedAt"`
	ShippedQuantity     int                      `json:"shippedQuantity" bson:"shippedQuantity"`
	ShopId              int                      `json:"shopId" bson:"shopId"`
	Id                  int                      `json:"id" bson:"id"`
	AppliedQuantity     int                      `json:"appliedQuantity" bson:"appliedQuantity"`
	UpdatedAt           int                      `json:"updatedAt" bson:"updatedAt"`
	Status              int                      `json:"status" bson:"status"`
}
